//package com.liu.manag.aspect;
//
//import com.liu.manag.annotation.MyLog;
//import com.liu.manag.entity.ActionLog;
//import com.liu.manag.service.ActionLogService;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.AfterReturning;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.lang.reflect.Method;
//import java.security.Principal;
//import java.time.LocalDateTime;
//
//@Aspect
//@Component
//public class ActionLogAspect {
//
//    @Autowired
//    private ActionLogService actionLogService;
//
//    @Pointcut("@annotation(com.liu.manag.aspect.MyLog)")
//    public void actionLogPointCut() {
//
//    }
//
//    @AfterReturning("actionLogPointCut()")
//    public void saveActionLog(JoinPoint point, Principal principal) {
//        ActionLog actionLog = new ActionLog();
//
//        //从切面织入点获取方法
//        MethodSignature signature = (MethodSignature) point.getSignature();
//
//        // 获取切入点所在的方法
//        Method method = signature.getMethod();
//
//        //获取操作
//        MyLog myLog = method.getAnnotation(MyLog.class);
//
//        if(myLog != null){
//            actionLog.setAction(myLog.value());
//        }
//
//        actionLog.setActionTime(LocalDateTime.now());
//        actionLog.setU
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//    }
//
//
//}
